
Cheese(function () {

// Widget Basic Default Setting
( Cheese('body').find('.setTitle').size() == 0 && Cheese('body').append('<div class="setTitle"></div>') );
( Cheese('body').find('.rssTime').size() == 0 && Cheese('body').append('<div class="rssTime"></div>') );

Cheese('body').append('<div class="blackBlank"></div>'); // Black Blank Element
Cheese('body').append('<div class="whiteBlank"></div>'); // Black Blank Element
Cheese('body').contents().not( Cheese("#idle").dom() )
			.wrapAll('<div class="widgetWrap"></div>'); // Widget Wrapping
Cheese('body').find('.scene').wrapAll('<div class="scenes"></div>');

// Busy Indicator Default Setting
Cheese('.blackBlank')
.before('<div class="popup" id="busyIndicator"><div class="busyIndicator type1"></div><div class="busyIndicatorTxt">Loading, Please wait...</div></div>')
.before('<div class="popup" id="alert"></div>');

Cheese('.scene').set();
Cheese('.title').set();
Cheese('.setTitle').set();
Cheese('.list').set();
Cheese('.setList').set();
Cheese(".tab").set();
Cheese(".popup").set();
Cheese(".pageControl").set();

var agent = navigator.userAgent;
if( agent.indexOf("SHW-M110S") != -1)
	Cheese("title").before('<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1; target-densitydpi=device-dpi"/>');
else if( Cheese.isWidget() )
	Cheese("title").before('<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1; target-densitydpi=120"/>');

Cheese.option( {
	"softkeySetListData" : {
		"OK" : function() {
			var sceneInfo = CheeseGlobal.sceneStack.pop();
				CheeseGlobal.sceneStack.push(sceneInfo);

			Cheese.back();
			Cheese(sceneInfo[0]).find(".setList").execFunc();
		}
	},
	"softkeySetListFunc" : function() {
		var sceneInfo = CheeseGlobal.sceneStack.pop(),
			selectData = CheeseGlobal.setListSelectData,
			setList = Cheese(sceneInfo[0]).find(".setList"),
			setListDataSet = setList.buffer("CheeseSetListComponentDataSet");
		CheeseGlobal.sceneStack.push(sceneInfo);

		for( var k in setListDataSet )
			setList.select(setListDataSet[k].key, "off");

		for( var k in selectData )
			setList.select(selectData[k], "on");

		Cheese.back();
	},
	"eventType" : (Cheese.isWidget()) ? "touch" : "mouse",
	"softkeyFunc" : function () { Cheese.back(); },
	"softkeyType" : "type1",
	"softkeyData" : {}
});

if(Cheese.isWidget())
	widget.addEventListener("widgetendkey",
	function()
	{
		Cheese.go("#idle");
	}, false);

Cheese.go("#idle");

}); //End Load

